/*
 * SocialRewardResource.h
 *
 *  Created on: 2013. 9. 6.
 *      Author: mega@gamevil.com
 */

#ifndef SOCIALREWARDRESOURCE_H_
#define SOCIALREWARDRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class SocialRewardData
{
public:
	enum SocialRewardType
	{
		__NONE__,
		FriendBuff,
		Heart,
		GameFriendReq,
		BoastPvPRankUp,
		BoastRefine,
		BoastLegendFairy,
		BoastWeekRank1,
		BoastWeekRank2,
		BoastWeekRank3,
		InviteNoAppFriend,
		NoPlayFriend,
		__MAX__,
	};

public:
	struct Flyweight
	{
		int _SEQ;
		int _SEND_REWARD;
		int _RECV_REWARD;
		int _MSG_TYPE;			/* 1:서버푸시, 2:카카오톡 메시지 */
		int _IS_EVENT;			/* 이벤트 적용 여부 (2이상 적용) */
	};

public:
	SocialRewardData() {};
	virtual ~SocialRewardData();

	bool LoadResource(int company, int saleCode);
	Flyweight * GetFly(int seq);

private:
	void	Clear();

private:
	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE	clsFlyTree;
};


class SocialRewardResource
{
public:
	SocialRewardResource();
	virtual ~SocialRewardResource();

	bool LoadResource();
	SocialRewardData::Flyweight * GetFly(User * pUser, int seq);

private:
	SocialRewardData * pSocialRewardAndroid;
	SocialRewardData * pSocialRewardIOS;
};

} /* NResource */ } /* ProjectZ */


#endif /* SOCIALREWARDRESOURCE_H_ */
